home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / S9303.ZIP;1 / SPENCE.ZIP / ABSUPER.PRG < prev    next >
Encoding:
Text File  |  1993-01-06  |  935 b   |  38 lines

  1. // AbSuper.prg
  2. //
  3. // Specification and implementation of array browsing
  4. // class using SuperClass
  5.  
  6. #include "SuperCls.ch"
  7.  
  8. CLASS arrayBrowse INHERIT FROM ScTBrowse
  9.  
  10. EXPORTED
  11.   VAR arrayIndex
  12.   VAR arrayReference
  13.  
  14.   MESSAGE Init
  15.  
  16. END CLASS
  17.  
  18.  
  19. METHOD Init()
  20.  
  21.   ::InitNew()
  22.   ::arrayIndex := 1
  23.   ::goTopBlock    := {|| ::arrayIndex := 1 }
  24.   ::goBottomBlock := {|| ::arrayIndex := Len(::arrayReference) }
  25.  
  26.   // Standard array skipper
  27.   ::skipBlock     := {|nToSkip, nTemp| ;
  28.                        nTemp := ::arrayIndex, ;
  29.                        ::arrayIndex := ;
  30.                          iif(nToSkip > 0, ;
  31.                              Min(::arrayIndex + nToSkip,      ;
  32.                                  Len(::arrayReference)),      ;
  33.                              Max(1, ::arrayIndex + nToSkip)), ;
  34.                        ::arrayIndex - nTemp                   ;
  35.                        }
  36.  
  37. RETURN Self
  38.